'use strict';
module.exports = {
	/**
	 * XXXnameXXX
	 * @url admin/ai-tool/sys/tool-vip-list 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------
    res = await vk.baseDao.getTableData({
      dbName: 'ai-user-tool',
      data,
      sortArr: [{ "name": "create_time","type": "desc" }],
      foreignDB: [
        {
          dbName:"uni-id-users",
          localKey:"user_id",
          foreignKey:"_id",
          as:"userInfo",
          limit:1
        },
        {
          dbName:"ai-tool",
          localKey:"tool_id",
          foreignKey:"_id",
          as:"toolInfo",
          limit:1
        }
      ]
    });

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
